onNestedPreFling

abstract fun onNestedPreFling(@NonNull target: View, velocityX: Float, velocityY: Float): Boolean(source)

React to a nested fling before the target view consumes it.

This method siginfies that a nested scrolling child has detected a fling with the given velocity along each axis. Generally this means that a touch scroll has ended with a velocity in the direction of scrolling that meets or exceeds the minimum fling velocity along a scrollable axis.

If a nested scrolling parent is consuming motion as part of a pre-scroll, it may be appropriate for it to also consume the pre-fling to complete that same motion. By returning true from this method, the parent indicates that the child should not fling its own internal content as well.

Return

true if this parent consumed the fling ahead of the target view

Parameters

target

View that initiated the nested scroll

velocityX

Horizontal velocity in pixels per second

velocityY

Vertical velocity in pixels per second